# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rbvmomi
_gemname=rbvmomi
pkgver=3.0.0
pkgrel=5
pkgdesc="Ruby interface to the VMware vSphere API"
url="https://github.com/vmware-archive/rbvmomi"
arch="noarch"
license="MIT"
depends="ruby ruby-builder ruby-nokogiri ruby-optimist"
checkdepends="ruby-rake ruby-test-unit"
source="https://github.com/vmware-archive/rbvmomi/archive/v$pkgver/$_gemname-$pkgver.tar.gz
	remove-extra-test-deps.patch
	"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm -r "$gemdir"/cache \
		"$gemdir"/doc \
		"$geminstdir"/LICENSE \
		"$geminstdir"/*.md
}

sha512sums="e01d8ca38877066bfba67d0b5b5c616bd4124b80b02560aca203d6e6ebc065cd24c2a709438bd77d904c80ade4cdd5f2ca105cbd86d3711ec2dbce1a9f7ca88c  rbvmomi-3.0.0.tar.gz
0309f4126420aaff4d570f7e580a91929107f7296c01654b8368bec5233e3673d7038cc88251d6844838974d6ab798f0c07e61faca640b09520ba3973f8c6082  remove-extra-test-deps.patch"
